package com.liu.thread.ch03;

public class TickeWindow extends Thread {
	
private static int ticket = 1000;
	
	@Override
	public void run() {
		
		//因为不是卖1张票。所以用循环
		while(true){
			if(ticket>0){
				System.out.println(this.getName()+"售票。票号为："+ticket);
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				
				ticket = ticket-1;
			}else{
				break;
			}
		}
	}

}
